<template>
    <div>
        <van-cell-group  v-for="(item,index) in list" :key="index">
            <van-cell @click="toinfo(item)" is-link :title="'[ '+item.type+' ] '+item.title"/>
        </van-cell-group>
<!--        <div v-for="(item,index) in list" :key="index">-->
<!--            <div class="van-card" @click="toinfo(item)">-->
<!--                <div class="van-card__header">-->
<!--                    <a class="van-card__thumb">-->
<!--                        <div class="van-image" style="width: 100%; height: 100%;">-->
<!--                            <img :src="item.url"-->
<!--                                 class="van-image__img" style="object-fit: cover;">-->
<!--                        </div>-->
<!--                    </a>-->
<!--                    <div class="van-card__content">-->
<!--                        <div>-->
<!--                            <div class="van-card__title van-multi-ellipsis&#45;&#45;l2">-->
<!--                                {{item.title}}-->
<!--                            </div>-->
<!--                        </div>-->
<!--                        <div class="van-card__bottom">-->
<!--                            <van-tag round type="primary" style="margin-right: 5px">标签</van-tag>-->
<!--                            <van-tag round type="danger">标签</van-tag>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
<!--            <van-divider />-->
<!--        </div>-->
    </div>
</template>

<script>
import { yiqinggettufen } from '@/api/yi-qing-fang-kong.js'
export default {
  name: 'index',
  data () {
    return {
      list: []
    }
  },
  methods: {
    init () {
      yiqinggettufen().then(ret => {
        if (ret.data.errcode === 0) {
          console.log('.1111')
          this.list = ret.data.data.result
        }
      })
    },
    toinfo (data) {
      let id = data.id
      console.log(id)
      this.$router.push({
        name: 'detail',
        query: {
          'id': id,
          type: 'trends'
        }
      })
    }
  },
  mounted () {
    this.init()
  }
}
</script>
<style scoped>
    .van-card{
        background-color: inherit;
        padding: 10px;
    }
    .van-card:not(:first-child){
        margin-top: 0;
    }
    .van-divider{
        margin: 0;
    }
</style>
